package com.huike.report.mapper;

import com.huike.report.domain.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.huike.clues.domain.TbActivity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author STJ12138
 * @version 1.0
 * @description: TODO
 * @date 2023/7/13 9:23
 */
@Mapper
public interface ReportMapper {
    /**
     * @description: 客户统计新增客户数报表
     * @param: beginTime
     * endTime
     * @return: java.lang.Double
     * @author STJ12138
     * @date: 2023/7/13 17:37
     */
    Double contractStatisticsChart(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);

    /**
     * @description: 销售统计归属部门明细列表
     * @param: beginCreateTime
     * endCreateTime
     * @return: java.util.List<com.huike.report.domain.vo.ReportSalesDeptStatisticsListDataVo>
     * @author STJ12138
     * @date: 2023/7/13 17:38
     */
    List<ReportSalesDeptStatisticsListDataVo> deptStatisticsList(@Param("beginCreateTime") LocalDateTime beginCreateTime,
                                                                 @Param("endCreateTime") LocalDateTime endCreateTime);

    /**
     * @description: 销售统计归属人报表
     * @param: beginCreateTime
     * endCreateTime
     * @return: java.util.List<com.huike.report.domain.vo.ReportSalesOwnerShipStatisticsListDataVo>
     * @author STJ12138
     * @date: 2023/7/13 17:38
     */
    List<ReportSalesOwnerShipStatisticsListDataVo> ownerShipStatisticsList(@Param("beginCreateTime") LocalDateTime beginCreateTime, @Param("endCreateTime") LocalDateTime endCreateTime);

    /**
     * @description: 销售统计报表
     * @param: beginTime
     * endTime
     * @return: java.lang.Double
     * @author STJ12138
     * @date: 2023/7/13 17:38
     */
    Double salesStatistics(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);

    /**
     * @description: 客户统计学科分布统计报表
     * @param: begin
     * end
     * @return: java.util.List<com.huike.report.domain.vo.ReportSubjectStatisticsDataVo>
     * @author STJ12138
     * @date: 2023/7/13 17:38
     */
    List<ReportSubjectStatisticsDataVo> subjectStatistics(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);

    /**
     * @description: 查询到所有线索
     * @param: begin
     * end
     * @return: java.lang.Integer
     * @author STJ12138
     * @date: 2023/7/13 19:30
     */
    Integer getcluesNums(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);

    /**
     * @description: 查询有效线索
     * @param: begin
     * end
     * @return: java.lang.Integer
     * @author STJ12138
     * @date: 2023/7/13 19:30
     */
    Integer geteffectiveCluesNums(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);

    /**
     * @description: 查询转换成商机的线索
     * @param: begin
     * end
     * @return: java.lang.Integer
     * @author STJ12138
     * @date: 2023/7/13 19:31
     */
    Integer getbusinessNums(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);

    /**
     * @description: 查询转换成客户的线索
     * @param: begin
     * end
     * @return: java.lang.Integer
     * @author STJ12138
     * @date: 2023/7/13 19:31
     */
    Integer getcontractNums(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);


    String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);

    List<ReportSalesChannelStatisticsListDataVo> channelStatistics(@Param("beginCreateTime") String beginCreateTime,
                                                                   @Param("endCreateTime") String endCreateTime);



    Integer getClueNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getBusinessNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getContractNum(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Double getSalesAmount(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);



    Integer getTodayClueNum(Long userId);

    Integer getTodayBusinessNum(Long userId);

    Integer getTodayContractNum(String userName);

    Double getTodaySalesAmount(String userName);

    Integer getToallocatedCluesNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);
    Integer getToallocatedBusinessNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getTofollowedBusinessNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getTofollowedCluesNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getChangeCluesNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getChangeBusinessNum(@Param("userId") Long userId, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);
}
